package com.musiklegal;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.app.ListActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class ArtistList extends ListActivity
{
	
	static String []aname;
	static String []id;
	
	public void onCreate(Bundle savedInstanceState) 
	{
	  super.onCreate(savedInstanceState);

	  setListAdapter(new ArrayAdapter<String>(this, R.layout.abc, aname));

	  ListView lv = getListView();
	  lv.setTextFilterEnabled(true);

	  lv.setOnItemClickListener(new OnItemClickListener()
	  {

		public void onItemClick(AdapterView<?> arg0, View arg1, int pos,
				long arg3) {
			
			
			OnlineC.catl.clear();
			AnotherSong.artistId=id[pos];
			AnotherSong.merchantKey=Browseby.apikey;
			TrackInfo.isCatalogue=false;
			startActivity(new Intent(getApplicationContext(),AnotherSong.class));
		}
	    
	  });
	}
	private InputSource retrieveInputStream(HttpEntity httpEntity) {
        InputSource insrc = null;
        try {
              insrc = new InputSource(httpEntity.getContent());
        } catch (Exception e) {
        }
        return insrc;
  }	
	public void onResume()
	{
		super.onResume();
		if(!MusikLegal.internet(getApplicationContext()))
		{
			finish();
		}
		OnlineC.catl.clear();
		
	}
}
